package com.example.jack.community.view.dynamic.dynamic_bean;

import android.app.Application;

import com.crazypudding.greendaodemo.greendao.dao.DaoMaster;
import com.crazypudding.greendaodemo.greendao.dao.DaoMaster.DevOpenHelper;
import com.crazypudding.greendaodemo.greendao.dao.DaoSession;

import org.greenrobot.greendao.database.Database;

/**
 * Created by DP on 2017/11/20.
 */

public class MyApplication extends Application {
    private DaoSession daoSession;

    @Override
    public void onCreate() {
        super.onCreate();

        DevOpenHelper helper = new DaoMaster.DevOpenHelper(this, "company-db");
        Database db = helper.getWritableDb();
        daoSession = new DaoMaster(db).newSession();
    }

    public DaoSession getDaoSession() {
        return daoSession;
    }


}
